import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import('@/views/Home/home')//首页
const Category = () => import('@/views/Category/Category')//商品列表
const Goods = () => import('@/views/goods/goods')//商品详情
const ShopCart = () => import('@/views/shopCart/shopCart')//购物车


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: '首页',
    component: Home
  },
  {
    path:'/category',
    name:'商品列表',
    component:Category
  },
  {
    path:'/goods',
    name:'商品详情',
    component:Goods
  },
  {
    path:'/shopCart',
    name:'购物车',
    component:ShopCart
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
